package com.hut.kwk.controller;

import com.hut.kwk.constant.ServerResponse;
import com.hut.kwk.service.IArrService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 */
@RestController
@RequestMapping("/process/")
public class ArrController {

    @Autowired
    private IArrService iArrService;

    @RequestMapping("arr")
    public ServerResponse<String> arr() {
        return iArrService.arr(20);
    }

    /**
     * 排课算法接口，传入学期开始去查对应学期的开课任务，进行排课，排完课程后添加到排课表
     *
     * @param semester
     * @return
     */
    @PostMapping("/arrange/{semester}")
    public ServerResponse arrange(@PathVariable("semester") String semester) {
        return iArrService.classScheduling(semester);
    }

}
